<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:jsp="http://java.sun.com/JSP/Page" 
	xmlns:c="http://java.sun.com/jstl/core" 
	xmlns:ice="http://www.icesoft.com/icefaces/component">

	<h:head>
		<meta http-equiv="Content-Type"
			content="text/html; charset=ISO-8859-1" />
	</h:head>

	<h:form id="form">
		<h:panelGrid columns="3" id="grid">
			<h:outputLabel value="Nome:" />
			<p:inputText id="nome" value="#{pessoaMB.pessoa.nome}" size="20"
				required="true" requiredMessage="Campo Obrigatório" />
			<p:message for="nome" />

			<h:outputLabel value="Endereco:" />
			<p:inputText id="end" value="#{pessoaMB.pessoa.endereco}" size="20"
				required="true" requiredMessage="Campo Obrigatório" />
			<p:message for="end" />

			<h:outputLabel value="Numero:" />
			<p:inputText id="nro" value="#{pessoaMB.pessoa.numero}" size="20" />
			<p:message for="nro" />

			<h:outputLabel value="Telefone:" />
			<p:inputText id="tel" value="#{pessoaMB.pessoa.telefone}" size="20" />
			<p:message for="tel" />

			<h:outputLabel value="Cidade:" />
			<p:inputText id="mun" value="#{pessoaMB.pessoa.cidade}" size="20"
				required="true" requiredMessage="Campo Obrigatório" />
			<p:message for="mun" />

			<p:commandButton id="btnE" value="Enviar" type="submit"
				action="#{pessoaMB.salvarPessoa}" process="@form"
				update="form:tablePessoa grid" />
			<p:commandButton id="btnL" value="Limpar" type="reset" />

		</h:panelGrid>

		<h:panelGrid>
			<p:dataTable id="tablePessoa" value="#{pessoaMB.pessoaLista}" var="p"
				rows="10" emptyMessage="Nao ha cadastros de registros na tabela" paginator="true">
				<p:column>
					<f:facet name="header">
						<h:outputText value="NOME" />
					</f:facet>
					<h:outputText value="#{p.nome}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="ENDERECO" />
					</f:facet>
					<h:outputText value="#{p.endereco}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="NUMERO" />
					</f:facet>
					<h:outputText value="#{p.numero}" />
				</p:column>
				
				<p:column>
					<f:facet name="header">
						<h:outputText value="TELEFONE" />
					</f:facet>
					<h:outputText value="#{p.telefone}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="CIDADE" />
					</f:facet>
					<h:outputText value="#{p.cidade}" />
				</p:column>
			</p:dataTable>
		</h:panelGrid>
	</h:form>


	
	<h:form prependId="false">  
  
    <p:dataTable id="dataTable" var="car" value="#{tableBean.cars}"  
                 paginator="true" rows="10" emptyMessage="Nao ha cadastros de registros na tabela"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15">  
        <f:facet name="header">  
            Cadastro de produtos  
        </f:facet>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Model" />  
            </f:facet>  
            <h:outputText value="#{car.model}" />  
        </p:column>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Year" />  
            </f:facet>  
            <h:outputText value="#{car.year}" />  
        </p:column>
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Year" />  
            </f:facet>  
            <h:outputText value="#{car.year}" />  
        </p:column>  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Year" />  
            </f:facet>  
            <h:outputText value="#{car.year}" />  
        </p:column>  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Year" />  
            </f:facet>  
            <h:outputText value="#{car.year}" />  
        </p:column>  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Year" />  
            </f:facet>  
            <h:outputText value="#{car.year}" />  
        </p:column>  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Year" />  
            </f:facet>  
            <h:outputText value="#{car.year}" />  
        </p:column>  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Year" />  
            </f:facet>  
            <h:outputText value="#{car.year}" />  
        </p:column>  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Year" />  
            </f:facet>  
            <h:outputText value="#{car.year}" />  
        </p:column>    
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Manufacturer" />  
            </f:facet>  
            <h:outputText value="#{car.manufacturer}" />  
        </p:column>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Color" />  
            </f:facet>  
            <h:outputText value="#{car.color}" />  
        </p:column>  
    </p:dataTable>  
  
</h:form> 


<h:form>  
  
    <p:dataTable id="dataTable" var="car" value="#{tableBean.carsSmall}" sortMode="multiple" rows="25" 
    	paginator="true" emptyMessage="Nao ha cadastros de registros na tabela">  
        <f:facet name="header">  
            Cadatro de Materia Prima 
        </f:facet>  
  
        <p:column sortBy="#{car.model}" headerText="Model">  
            <h:outputText value="#{car.model}" />  
        </p:column>  
  
        <p:column sortBy="#{car.year}" headerText="Year">  
            <h:outputText value="#{car.year}" />  
        </p:column>  
  
        <p:column sortBy="#{car.manufacturer}" headerText="Manufacturer">  
            <h:outputText value="#{car.manufacturer}" />  
        </p:column>  
  
        <p:column sortBy="#{car.color}" headerText="Color">  
            <h:outputText value="#{car.color}" />  
        </p:column>  
    </p:dataTable>  
  
</h:form>  

<h:form> 
<h3>X Scrolling</h3>  
    <p:dataTable var="car" value="#{tableBean.carsSmall}" scrollable="true" scrollWidth="400" id="dataTable2">  
  
        <p:column headerText="Model">  
            <h:outputText value="#{car.model}" />  
        </p:column>  
  
        <p:column headerText="Year">  
            <h:outputText value="#{car.year}" />  
        </p:column>  
  
        <p:column headerText="Manufacturer">  
            <h:outputText value="#{car.manufacturer}" />  
        </p:column>  
  
        <p:column headerText="Color">  
            <h:outputText value="#{car.color}" />  
        </p:column>  
  
    </p:dataTable>  
</h:form> 

</ui:composition>


